<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script type="text/javascript">
var ws = new WebSocket(parent.document.wsUrl);
ws.onopen = function()
{
    // Send "socket1" to server, so that "socket1" will be broadcasted to
    // WebSockets connected to close-on-unload when this WebSocket is closed.
    ws.send("socket1");
};
ws.onmessage = function(evt)
{
    // "socket1" is received by server, so ready to unload this document.
    parent.document.iframeReady(evt.data);
}
</script>
</body>
</html>
